package com.ibm.cloud.envcheck.service.type;

import java.util.List;

import com.ibm.cloud.envcheck.kit.EnumUtil;
import com.ibm.cloud.envcheck.kit.IndexedEnum;

public enum ServiceType implements IndexedEnum{
	
	PING("ping",100),
	TELNET("telnet",101),
	SSH("ssh",102),
	REST("rest",103),
	REMOTE_COMMAND_LINE("remote_command_line",104),
	SOCKET("socket",105),
	REMOTE_CONFIG_JSON("remote_config_json",106),
	REMOTE_CONFIG_XML("remote_config_xml",107),
	REMOTE_CONFIG_CONF("remote_config_conf",108);
	
	private String type;
	private int code;
	
	
	private static final List<ServiceType> values = IndexedEnumUtil.toIndexes(ServiceType.values());

	private ServiceType(String type,int code){
		this.type = type;
		this.code = code;
	}
	
	@Override
	public int getIndex() {
		return code;
	}


	public static ServiceType valueOf(int code) {
		return EnumUtil.valueOf(values, code);
	}
	

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}
}
